<?php


namespace App\Http\Controllers\android\validate;


use Illuminate\Support\Facades\Validator;

class sn
{
    public static function bindSn($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getSnInfo($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function uploadAppUseInfo($param){
        $rules = [
            'sn'=>'required|between:11,13',
            'appInfo'=>'required',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
            'appInfo.required'=>'json为空',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function updateAdminSn($param){
        $rules = [
            'sn'=>'required|between:11,13',
            'address'=>'required',
            'machine'=>'required',
            'hardware'=>'required',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
            'address.required'=>'地址为空',
            'machine.required'=>'设备信息为空',
            'hardware.required'=>'硬件信息为空',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function querySnAppStart($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function querySnJump($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function uploadScreenshot($param){
        $rules = [
            'sn'=>'required|between:11,13',
            'file'=>'required|file'
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
            'file.required'=>'文件为空',
            'file.file'=>'文件格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getTimeControl($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getScreenshot($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getUserAvatarInfo($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function saveSnUid($param){
        $rules = [
            'sn'=>'required|between:11,13',
            'uid'=>'required',
            'card_info'=>'required',
            'grade'=>'required',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',
            'uid.required'=>'uid不能为空',
            'card_info.required'=>'学习卡信息不能为空',
            'grade.required'=>'年级不能为空',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getSnUid($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function deleteSnUid($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function getBatch($param){
        $rules = [
            'sn'=>'required|between:11,13',
        ];
        $msg = [
            'sn.required'=>'sn码为空',
            'sn.between'=>'sn码长度不正确',

        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }


    
}